/*
 * @Author: shenya
 * @Date: 2023-09-14 14:11:32
 * @Description: 动态内容api
 */
import request from '@/router/axios';
//查询
export function selectDynamicQuery(query) {
  return request({
    url: '/core/share/page',
    method: 'get',
    params: query,
  });
}
//通过id查询
export function selectDynamicById(id) {
  return request({
    url: `/core/share/platform/${id}`,
    method: 'get',
  });
}
//修改
export function updateRules(data) {
  return request({
    url: '/core/share',
    method: 'put',
    data,
  });
}
//删除
export function deleteRulesById(id) {
  return request({
    url: `/core/share/${id}`,
    method: 'delete',
  });
}
//批量精选
export function batchShareChoice(data) {
  return request({
    url: '/core/share/choice',
    method: 'put',
    data,
  });
}
//屏蔽动态
export function shieldDynamic(params) {
  return request({
    url: `/core/share/shield/${params.id}/${params.flag}`,
    method: 'put',
  });
}
//置顶
export function topShareChoice(data) {
  return request({
    url: `/core/share/top`,
    method: 'put',
    data,
  });
}
//查询灌水账号
export function selectUser(params) {
  return request({
    url: '/app/appuser/page',
    method: 'get',
    params,
  });
}
//灌水点赞
export function changelikeOrComment(data) {
  return request({
    url: '/core/pet/social/thumb/up/batch',
    method: 'post',
    data,
  });
}
//灌水评论
export function changeComment(data) {
  return request({
    url: '/core/comment/batch',
    method: 'post',
    data,
  });
}
// 新增
export function addRules(data) {
  return request({
    url: '/core/share',
    method: 'post',
    data,
  });
}
//获取置顶的默认时间
export function getTopTime() {
  return request({
    url: '/core/share/top/time',
    method: 'get',
  });
}
//获取投票记录
export function getVoteRecord(params) {
  return request({
    url: '/core/share/pk/page',
    method: 'get',
    params,
  });
}
//基地播报 取消播报
export function playAnnounce(params) {
  return request({
    url: `/core/share/announce/${params.id}/${params.flag}`,
    method: 'put',
  });
}
